package com.redijedi.tapestry.util;

import java.util.Arrays;
import java.util.List;

import org.apache.tapestry.OptionGroupModel;
import org.apache.tapestry.OptionModel;
import org.apache.tapestry.util.AbstractSelectModel;

/**
 * @author torr
 * 
 */
public final class SelectModelImpl extends AbstractSelectModel {

	private final List<OptionGroupModel> _optionGroups;

	private final List<OptionModel> _optionModels;

	public SelectModelImpl(final List<OptionGroupModel> optionGroups,
			final List<OptionModel> optionModels) {
		_optionGroups = optionGroups;
		_optionModels = optionModels;
	}

	public SelectModelImpl(OptionModel... optionModels) {
		this(null, Arrays.asList(optionModels));
	}

	public SelectModelImpl(OptionGroupModel... groupModels) {
		this(Arrays.asList(groupModels), null);
	}

	public List<OptionGroupModel> getOptionGroups() {
		return _optionGroups;
	}

	public List<OptionModel> getOptions() {
		return _optionModels;
	}

}
